<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>旋转立方体</title>
    <style>
        body{
            background: #000;
            perspective: 1000px;
            perspective-origin:1000px  100px;
        }
        .cube{
            width: 200px;
            height: 200px;
            background: #ffffff;
            border-radius: 6px;
            text-align: center;
            line-height: 200px;
            font-size: 100px;
            opacity: 0.6;
            position: absolute;
            top:0;
            left:0;
        }
        #container {
            width: 200px;
            height: 200px;
            margin: 200px auto;
            position: relative;
            transform-style: preserve-3d;
            animation:rotate 2s linear infinite;
        }
        .one{
            transform: rotateY(180deg)  translateZ(100px);
        }
        .two{
            transform: rotateX(90deg)  translateZ(100px);
        }
        .three{
            transform:translateZ(100px);
        }
        .four{
            transform: rotateY(-90deg) translateZ(100px);
        }
        .five{
             transform: rotateY(90deg)  translateZ(100px);
        }
        .six{
            transform: rotateX(-90deg)  translateZ(100px);
        }
        @keyframes rotate {
            from{

            }
            to{
                transform: rotateY(-360deg);
            }
        }
    </style>
</head>
<body>
<div id="container">
    <div class="cube one">1</div>
    <div class="cube two">2</div>
    <div class="cube three">3</div>
    <div class="cube four">4</div>
    <div class="cube five">5</div>
    <div class="cube six">6</div>
</div>
</body>
</html>







































































